import { lazy } from 'react'
import { Navigate } from 'react-router-dom'
import type { RoutePropsExtend } from './route.ts'

const RuomView = lazy(() => import('@/pages/system/ruom/ruom.tsx'))
const Recommend = lazy(() => import('@ruom/recommend/recommend'))
// eslint-disable-next-line react-refresh/only-export-components
const Classification = lazy(
  () => import('@ruom/classification/classification.tsx')
)
const RuomWalk = lazy(() => import('@ruom/ruom-walk/ruom-walk.tsx'))
const RuimStart = lazy(() => import('@ruom/ruim-start/ruim-make.tsx'))
const Recognition = lazy(
  () => import('@ruom/music-recognition/music-recognition.tsx')
)
const UserTheme = lazy(() => import('@ruom/user-profile/UserTheme.tsx'))
const UserDetail = lazy(() => import('@ruom/user-profile/UserDetail.tsx'))
const UserConfigured = lazy(
  () => import('@ruom/user-profile/UserConfigured.tsx')
)
const SingerDetail = lazy(() => import('@ruom/details/SingerDetail.tsx'))
const PlaylistDetail = lazy(
  () => import('@ruom/details/PlaylistDetail.tsx')
)
const SearchDetail = lazy(() => import('@ruom/details/SearchDetail.tsx'))
const SongDetail = lazy(() => import('@ruom/details/SongDetail.tsx'))
const UserLike = lazy(() => import('@ruom/user-profile/UserLike.tsx'))
const UserTimer = lazy(() => import('@ruom/user-profile/UserTimer.tsx'))

const routers: Array<RoutePropsExtend> = [
  {
    path: '/ruom',
    element: <RuomView></RuomView>,
    children: [
      {
        index: true,
        element: <Navigate to={'/ruom/recommend'}></Navigate>
      },
      // 推荐
      {
        path: '/ruom/recommend',
        meta: {
          title: '发现与推荐',
          icon: 'detection'
        },
        element: <Recommend></Recommend>
      },
      // 分类
      {
        path: '/ruom/classification',
        meta: {
          title: '音乐字典',
          icon: 'classification'
        },
        element: <Classification></Classification>
      },
      // // 排行榜
      // {
      //   path: '/ruom/ranking',
      //   meta: {
      //     title: '排行榜',
      //     icon: 'ranking'
      //   },
      //   element: <Ranking></Ranking>
      // },
      // 音乐漫步
      {
        path: '/ruom/ruomWalk',
        meta: {
          title: 'Roum 漫步',
          icon: 'ruim-walk'
        },
        element: <RuomWalk></RuomWalk>
      },
      // ruom创
      {
        path: '/ruom/ruimStart',
        meta: {
          title: 'Roum 创',
          icon: 'ruim-make'
        },
        element: <RuimStart></RuimStart>
      },
      // 音乐识别
      {
        path: '/ruom/music-recognition',
        element: <Recognition></Recognition>
      },
      // 搜索详细页
      {
        path: '/ruom/music-search',
        element: <SearchDetail></SearchDetail>
      },
      // 用户主题
      {
        path: '/ruom/themes',
        element: <UserTheme></UserTheme>
      },
      // 用户详细资料
      {
        path: '/ruom/user-detail',
        element: <UserDetail></UserDetail>
      },
      // 歌手详细资料
      {
        path: '/ruom/singer-detail',
        element: <SingerDetail></SingerDetail>
      },
      // 歌曲详细资料
      {
        path: '/ruom/song-detail',
        element: <SongDetail></SongDetail>
      },
      // 歌单，包含专辑详细资料
      {
        path: '/ruom/playlist-detail',
        element: <PlaylistDetail></PlaylistDetail>
      },
      // 用户系统配置
      {
        path: '/ruom/user-setting',
        element: <UserConfigured></UserConfigured>
      },
      {
        path: '/ruom/user-timer',
        element: <UserTimer></UserTimer>
      },
      // 用户喜欢
      {
        path: '/ruom/user-like',
        element: <UserLike></UserLike>
      },
      // 用户最近播放
      {
        path: '/ruom/user-timer',
        element: <UserTimer></UserTimer>
      },

    ]
  }
]

export default routers
